package com.synjones.zeuscloudapp.controller;

import com.synjones.zeuscloudapp.service.authorize.AuthorizeService;
import com.synjones.zeuscloudapp.util.DataPack;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author Think
 * Description: 设备授权
 * @date created in 10:29 2018-05-22
 * Modified by:
 */
@RestController
@RequestMapping("/Api")
public class AuthorizeController {

    private static final Logger LOG = LoggerFactory.getLogger(AuthorizeController.class);

    @Resource
    private AuthorizeService authorizeService;

    /**
    *  授权设备
    *  @param request
    *  @author Think
    *  Description: 授权设备
    *  @date 10:32 2018-05-22
    *  @return
    *  throws
    */
    @RequestMapping(value = "/authorizeDevice" , produces = "application/json;encoding=utf-8")
    public DataPack authorizeDevice(HttpServletRequest request){
        return authorizeService.buildDataPack(request);
    }

}
